$wgOut->addHTML( Html::rawElement( 'div', [ 'class' => 'hiddencats' ],
Linker::formatHiddenCategories( $this->page->getHiddenCategories() ) ) );
- $wgOut->addHTML( Html::rawElement( 'div', [ 'class' => 'limitreport' ],
- self::getPreviewLimitReport( $this->mParserOutput ) ) );
+ if ( $this->mParserOutput ) {
+ $wgOut->setLimitReportData( $this->mParserOutput->getLimitReportData() );
+ }
$wgOut->addModules( 'mediawiki.action.edit.collapsibleFooter' );
return '';
}
- $limitReport = Html::rawElement( 'div', [ 'class' => 'mw-limitReportExplanation' ],
- wfMessage( 'limitreport-title' )->parseAsBlock()
+ return ResourceLoader::makeInlineScript(
+ ResourceLoader::makeConfigSetScript(
+ [ 'wgPageParseReport' => $output->getLimitReportData() ],
+ true
+ )
);
-
- // Show/hide animation doesn't work correctly on a table, so wrap it in a div.
- $limitReport .= Html::openElement( 'div', [ 'class' => 'preview-limit-report-wrapper' ] );
-
- $limitReport .= Html::openElement( 'table', [
- 'class' => 'preview-limit-report wikitable'
- ] ) .
- Html::openElement( 'tbody' );
-
- foreach ( $output->getLimitReportData() as $key => $value ) {
- if ( Hooks::run( 'ParserLimitReportFormat',
- [ $key, &$value, &$limitReport, true, true ]
- ) ) {
- $keyMsg = wfMessage( $key );
- $valueMsg = wfMessage( [ "$key-value-html", "$key-value" ] );
- if ( !$valueMsg->exists() ) {
- $valueMsg = new RawMessage( '$1' );
- }
- if ( !$keyMsg->isDisabled() && !$valueMsg->isDisabled() ) {
- $limitReport .= Html::openElement( 'tr' ) .
- Html::rawElement( 'th', null, $keyMsg->parse() ) .
- Html::rawElement( 'td', null, $valueMsg->params( $value )->parse() ) .
- Html::closeElement( 'tr' );
- }
- }
- }
-
- $limitReport .= Html::closeElement( 'tbody' ) .
- Html::closeElement( 'table' ) .
- Html::closeElement( 'div' );
-
- return $limitReport;
}
protected function showStandardInputs( &$tabindex = 2 ) {
}
// Include profiling data
- $this->limitReportData = $parserOutput->getLimitReportData();
+ $this->setLimitReportData( $parserOutput->getLimitReportData() );
// Link flags are ignored for now, but may in the future be
// used to mark individual language links.
// public API or you'll be severely disappointed when T87871 is fixed and it disappears.
$this->addMeta( 'X-OOUI-PHP', '1' );
}
+
+ /**
+ * @param array $data Data from ParserOutput::getLimitReportData()
+ * @since 1.28
+ */
+ public function setLimitReportData( array $data ) {
+ $this->limitReportData = $data;
+ }
}